//
//  CRegisterView.h
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-31.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "UIViewEx.h"
#import "CLoginView.h"
#import "CUserPageCtrl.h"
#import "CCitySelector.h"

@class CUser;
@class PhotosViewController;
@class CameraViewController;

@protocol PhotoImagePickerDelegate;
@protocol CameraImagePickerDelegate;

//=======================================================================================================================

@interface CPosition : NSObject

@property (nonatomic, retain) NSString  *m_City;
@property (nonatomic, retain) NSString  *m_JDu;
@property (nonatomic, retain) NSString  *m_WDu;

@end

//=======================================================================================================================
@interface CCity : NSObject

@property (nonatomic, retain) NSString         *m_Section;
@property (nonatomic, retain) NSMutableArray   *m_Rows;

@end

//=======================================================================================================================

@interface CRegisterView : UIViewEx <UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource, CitySelectorProtocal, UIActionSheetDelegate, PhotoImagePickerDelegate, CameraImagePickerDelegate>

@property (nonatomic, assign) UIImageView       *m_Icon;
@property (nonatomic, assign) UIButton          *m_IconBtn;
@property (nonatomic, assign) UITextField       *m_Name;
@property (nonatomic, assign) UITextField       *m_Pwd;
@property (nonatomic, assign) UITextField       *m_Nick;
@property (nonatomic, assign) UITextField       *m_Mail;
@property (nonatomic, assign) UITextField       *m_Citytf;
@property (nonatomic, assign) UIButton          *m_City;
@property (nonatomic, assign) UIView            *m_Panel;
@property (nonatomic, assign) CGPoint           m_PanelCenter;
@property (nonatomic, assign) UIButton          *m_CommitBtn;
@property (nonatomic, assign) UIButton          *m_OldCounter;

//imagepicker
@property (nonatomic, assign) UIActionSheet         *m_Sheet;
@property (nonatomic, assign) PhotosViewController  *m_PhotoCtrl;
@property (nonatomic, assign) CameraViewController  *m_CamareCtrl;

//city
@property (nonatomic, assign) UITableView   *m_CityTable;
@property (nonatomic, assign) NSDictionary  *m_Cities;
@property (nonatomic, assign) int           m_PositionsNum;
@property (nonatomic, assign) NSMutableArray*m_Positions;
@property (nonatomic, retain) CAddrInfo     *m_AddInfo;

//action
@property (nonatomic, assign) id    m_Target;
@property (nonatomic, assign) SEL   m_Action;

-(void)DidChangeIconBtnDown:(UIButton*)sender;
-(void)DidCityBtnDown:(UIButton*)sender;
-(void)DidCommitBntDown:(UIButton*)sender;
-(void)DidOldCounterBtnDown:(UIButton*)sender;
-(void)DidTextFieldChanged:(UITextField*)textfield;
-(void)HiddenKeyBoard;

//imagepicker
-(void)ShowPickerView;
-(void)DidPickerViewBtnDown:(int)sender;
-(void)DidPhotograph:(UIImage*)image;

//city
-(void)InitCityPicker;
-(void)ShowCityPicker;
-(void)HiddenCityPicker;

@end
